#ifndef RSSCHANNEL_H
#define RSSCHANNEL_H

//includes 
#include <QList>
#include <QString>
#include <QTextStream>
#include "qrssglobals.h"
#include "rssleaf.h"

//forward declaration

typedef QList<RssLeaf*> QRssLeaves;

class RssChannel : public RssLeaf
{

public:
	RssChannel();
	~RssChannel();
	
	void				addItem( RssLeaf& item );
	int					countUnreaded(){ return m_unreaded; };
	const QRssLeaves&	leaves(){ return m_itemsList; };
	const RssLeaf&		leaf( int ind );
	void				readAll( );
	//TODO: temporary for parsing
	void				parserMark(){ m_getLink = true; };
	bool				parse() { return m_getLink; };

	void 				internalize( QTextStream& stream );
	void 				externalize( QTextStream& stream );
	QRssFType			type(){ return m_type; };
	void				setType( QRssFType type );
	void				setItemState(int ind, ItemState state );
	
private:
	QRssLeaves		m_itemsList;
	int				m_unreaded;
	bool			m_getLink;
	QRssFType		m_type;
	
};
#endif //RSSCHANNEL_H
//eof

